import { createBrowserRouter, Navigate } from "react-router";
import App from "../App";
import Home from "../pages/Home/Home";
import Data from "../pages/Data/Data";
import Activity from "../pages/Activity/Activity";
import Message from "../pages/Message/Message";
import Calendar from "../pages/Calendar/Calendar";
import Mail from "../pages/Mail/Mail";
import Order from "../pages/Data/Order";
import Customer from "../pages/Data/Customer";
import Comment from "../pages/Data/Comment";
import User from "../pages/Setting/User";
import Account from "../pages/Setting/Account";
import Notice from "../pages/Setting/Notice";
import Pay from "../pages/Setting/Pay";
import Login from "../pages/Login/Login";

const router = createBrowserRouter([
    {
        path: "/",
        element: <App />,
        children:[
            // 首页
            {
                path: "/home",
                element: <Home />,
            },
            // 数据
            {
                path: "/data",
                element: <Data />,
            },
            // 订单
            {
                path: "/order",
                element: <Order />,
            },
            // 客户名单
            {
                path: "/customer",
                element: <Customer />,
            },
            // 评论列表
            {
                path: "/comment",
                element: <Comment />,
            },
            // 活动
            {
                path: "/activity",
                element: <Activity />,
            },
            // 消息
            {
                path: "/message",
                element: <Message />,
            },
            // 日历
            {
                path: "/calendar",
                element: <Calendar />,
            },
            // 邮箱
            {
                path: "/mail",
                element: <Mail />,
            },
            // 个人信息
            {
                path: "/user",
                element: <User />,
            },
            // 账户设置
            {
                path: "/account",
                element: <Account />,
            },
            // 通知设置
            {
                path: "/notice",
                element: <Notice />,
            },
            // 支付设置
            {
                path: "pay",
                element: <Pay />,
            },
            // 默认
            {
                path: "/",
                element: <Navigate to="/home" />,
            }
        ],
    },
    // 登录
    {
        path: "/login",
        element: <Login />,
    },
])

export default router;